<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../component/elementUI/index.css">
  <link rel="stylesheet" href="../../../style/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :inline="true" :form="form">
      <el-form-item>
        <el-button type="primary" @click="Add">添加</el-button>
      </el-form-item>
      <el-form-item>
        <el-input v-model="form.News_Name" clearable :placeholder="'请输入'+News_Label+'标题'" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSerach">查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="success" @click="shenhelis">批量审核</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="danger" @click="shanchulis">批量删除</el-button>
      </el-form-item>
    </el-form>
    <el-tabs v-model="form.Row_Status" type="card" @tab-click="onSerach">
      <el-tab-pane label="全部" name="-"></el-tab-pane>
      <el-tab-pane label="审核中" name="0"></el-tab-pane>
      <el-tab-pane label="已通过" name="1"></el-tab-pane>
      <el-tab-pane label="已拒绝" name="2"></el-tab-pane>
    </el-tabs>
    <el-table :data="tableData" stripe border height="calc(100vh - 190px)" @selection-change="handleSelectionChange"
      style="width: 100%">
      <el-table-column align="center" type="selection" width="40"></el-table-column>
      <el-table-column align="center" label="序号" width="50" type="index"></el-table-column>
      <el-table-column align="center" width="200" prop="News_SerialNumber" :label="News_Label+'流水号'"></el-table-column>
      <el-table-column align="center" width="140" prop="News_Type" label="封面">
        <template v-slot="{row}">
          <el-image fit="contain" :src="Domain_Business + '/' + row.Picture_URL" :preview-src-list="['https://www.kdddy.cn/Image/' + row.Picture_URL]"  style="width: 100px; height: 100px;">
            <div slot="error" style="width: 100%;height: 100%;">
              <el-image fit="contain" :src="absolutepath() + 'admin/icons/updateError.png'" style="width:100px;height: 100px;">
            </div>   
          </el-image>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="News_Name" :label="News_Label+'标题'"></el-table-column>
      <el-table-column align="center" width="180" prop="News_Date" label="发布时间"></el-table-column>
      <!-- <el-table-column align="center" prop="New_Type_Name" label="分类标签">
        <template v-slot="{row}">
          <el-tag  v-if="row.New_Type_Name" style="margin-left: 5px;" v-for="(item,index) in row.New_Type_Name.split(';')" :key="index">{{item}}</el-tag>
        </template>
      </el-table-column> -->
      <el-table-column align="center" width="100" label="状态">
        <template v-slot="{row}">
          <el-tag :type="row.Row_Status=='1'?'success':row.Row_Status=='2'?'danger':''">
            {{row.Row_Status=='1'?'已通过':row.Row_Status=='2'?'已拒绝':'待审核'}}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column align="center" label="操作" width="180">
        <template v-slot="{row}">
          <!-- <el-button @click="handleOperate('show',row)" type="primary" size="small">查看</el-button> -->
          <el-dropdown @command="handleOperate($event,row)">
            <el-button type="primary" size="small">
              更多<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <template v-if="row.Row_Status=='0'">
                <el-dropdown-item command="approve">审核通过</el-dropdown-item>
                <el-dropdown-item command="refuse">审核拒绝</el-dropdown-item>
                <el-dropdown-item command="edit">修改</el-dropdown-item>
              </template>
              <el-dropdown-item v-else command="approve2">重新审核</el-dropdown-item>
              <el-dropdown-item command="remove">删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination background v-show="total > 0" @size-change="handleSizeChange" @current-change="handleCurrentChange"
      :current-page="form.page" :page-sizes="[10, 20, 30, 50]" :page-size="form.limit"
      layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
  </div>
  <script type="text/javascript" src="../../../utils/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../utils/vue.min.js"></script>
  <script type="text/javascript" src="../../../config/config.js"></script>
  <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
  <script type="text/javascript" src="../../../utils/utils.js"></script>
  <script type="text/javascript" src="./js/News.js"></script>
</body>

</html>